home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 17995 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.0 KB  |  41 lines

  1. Path: soap.news.pipex.net!pipex!usenet
  2. From: paul.ganney@dial.pipex.com (Paul S. Ganney)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: HELP need Date class !!!
  5. Date: Thu, 18 Apr 1996 13:16:34 GMT
  6. Organization: Medical Physics, Hull.
  7. Message-ID: <4l5f9e$gp4@soap.news.pipex.net>
  8. References: <316D3335.1487@enitab.fr>
  9. NNTP-Posting-Host: an105.du.pipex.com
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. ppx <ppx@enitab.fr> wrote:
  13.  
  14. >Hi.
  15. >I Need a Date class in C++ with source available wich handle date
  16. >< 1970 and > 2038 under Windows 3.1,95,and NT. I use MSVC 1.52.
  17. >Thanks
  18. >ppx@enitab.fr
  19.  
  20. Try something like this:
  21.  
  22. // date class definition
  23.  
  24. enum dformat{SHORT,LONG};
  25.  
  26. class date{
  27.     int day,month,year;
  28.     dformat df;
  29. public:
  30.     date(int d=1, int m=1, int y=1980) {df=SHORT;day=d;month=m;year=y;};
  31.     void set(int d, int m, int y);
  32.     void setformat(dformat d);
  33.     void display();
  34. };
  35.  
  36. Paul.
  37. --------------------------------------------------------------
  38. Expressed opinions are usually my own.
  39. --------------------------------------------------------------
  40.  
  41.